package com.itheima.minIo;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author :wujunjie
 * createTime :2023-01-01 21:43
 * description :
 */

@Configuration
@ConfigurationProperties(prefix = "minio")
@Data
public class MinIoConfigration {
    private  String accessKey ;
    private  String secretKey ;
    private  String bucket ;
    private  String endpoint ;
    private  String readPath ;
    @Bean
    public  MinioClient minioClient(){
        return MinioClient.builder().credentials(accessKey, secretKey).endpoint(endpoint).build();
    }

}
